home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: David Byrden <100101.2547@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Re: RE: No struct in C++!!?
- Date: 25 Feb 1996 22:21:57 GMT
- Organization: self-employed
- Message-ID: <4gqne5$ci3@news.bridge.net>
- References: <1996Feb14.151620.5532@queens-belfast.ac.uk> <00001a81+0000a7ee@msn.com>
- NNTP-Posting-Host: ppp-mia1-43.bridge.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
-
- >> I found in different C++ books examples of C++ programms
- >> which contain type declarations and definitions in the main() programm
- >> - for example a struct - as in C.
- >> My question is, whether this is a contradiction to the paradigm of
- >> C++.
-
-
- Firstly, those examples that you saw may have been classes. They
- keyword "struct" in C++ means almost exactly the same as "class".
-
- Secondly, a struct with public data members is certainly not what OOP
- is all about, but that does not make it the spawn of the devil. It may be
- so simple that you would be wasting time by encapsulating its data. Even
- in the standard library, there is a struct called "pair" which is used to
- bind two values together so that a function can return them both.
-
-
- David
-
-
-